package guo.mybatis;

import guo.mybatis.config.Configuration;
import guo.mybatis.mapper.UserMapper;
import guo.mybatis.model.User;
import guo.mybatis.session.SqlSession;
import guo.mybatis.session.SqlSessionFactory;


public class Main {
	public static void main(String[] args) {
		ClassLoader classLoader = Main.class.getClassLoader();
		Configuration configuration = new Configuration(classLoader,"mybatis.xml");
		SqlSessionFactory sqlSessionFactory = new SqlSessionFactory(configuration);
		SqlSession sqlSession = sqlSessionFactory.openSession();
		UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
		User user = userMapper.selectById(1);
		System.out.println(user);
	}
}


